<?php
	//购物车
	$count = Cart::getTotalNums();  
	if(empty($count)){
		$count=0;
	}
	//用户名
	use \Home\Model\User;
	if(isset($_SESSION['user'])){
		$userModel = new User();
		$uid = $_SESSION['user']['uid'];
		$userData = $userModel->where("uid={$uid}")->find();
	}
?>
<!--灰色区块-->
		<div id="heard_top">
			<div class="heard_body">
				<div class="heard_body_right">
					<div class="ddnewhead_welcome">
						<span class="welcome">欢迎光临当当，</span>
						{{if value="isset($_SESSION['user'])"}}
							<a href="{{U('Order/index')}}">{{$userData['account']}}</a><a href="{{U('Member/out')}}">[退出]</a>
						{{endif}}
						{{if value="empty($_SESSION['user'])"}}
							请<a target="_blank" href="{{U('Login/index')}}" class="denglu">登录</a>
							<a target="_blank" href="{{U('Member/reg')}}">成为会员</a>
						{{endif}}
					</div>
					<ul class="ddnewhead_operate_nav">
						<li>
							{{if value='!isset($count)'}}
								<a href="{{U('Cart/noCart')}}" class="cart">购物车<b>0</b>
							{{else}}
								<a href="{{U('Cart/index')}}" class="cart">购物车<!--<b>{{$count}}</b>--></a>
							{{endif}}
							</a>
						</li>
						<li>
							{{if value="isset($_SESSION['user'])"}}
								<a href="{{U('Order/index')}}">我的订单</a>
							{{else}}
								<a href="{{U('Login/index')}}">我的订单</a>
							{{endif}}
						</li>
							</ul>
						</li>
				</ul>
				</div>
			</div>
		</div>
		<!--灰色区块结束-->